#include"data_structure.h"

stack::stack()
{
	A= new int[sizeof(int)*100];
}
stack::~stack()
{
	if(A!=nullptr)
	delete A;
}

bool stack::stack_empty()
{
	if (0 > top)
		return false;
	return true;
}
int stack::size()
{
	return top + 1;
}
bool stack::push(int In)
{
	if (top>=99)
	{
		return false;
	}
	else {
		top++;
		*(A + top)=In;
		return true;
	}	
}
const int* stack::pop()
{
	if (top < 0) {
		return nullptr;
	}
	else
	{
		top--;
		return A+top+1;
	}
		
}
